<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sj" tagdir="/WEB-INF/tags/spring-jquery-tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<link href="<c:url value='/css/tablesorter.css' />" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						$('#pageTitle')
								.text(
										'<spring:message code="viewCipeprojectPaymentRequestLineItems.heading" />');
						$("#viewCipeprojectPaymentRequestLineItemsForm")
								.validate({
									rules : {
										name : {
											required : true
										}
									}
								});
						$('.tablesorter').tablesorter({
							widgets : [ 'zebra' ]
						});
					});
	$('.close-button').click(function() {
		//if (confirm('Are you sure you want to close the form?')) {
// 			window.location = '../secure/showDashboard.do';
			document.getElementById('btnBack').click();   
		//}
	});
	$('.edit-paymentrequest-link').click(
			function() {
				loadDiv('content', 'showEditPaymentrequest.do?id='
						+ $(this).attr('paymentrequestId'));
			});
</script>
<div id="viewCipeprojectPaymentRequestLineItemsDiv" class="hastable" style="overflow: auto">
	<form:form name="viewCipeprojectPaymentRequestLineItemsForm" id="viewCipeprojectPaymentRequestLineItemsForm" method="post" modelAttribute="cipeproject">
		<form:hidden path="id" />
		<div class="main_form">
			<div class="form_head">
				<a href="#" class="close-button gray_btn floatR">Close Form</a><br class="clear" />
			</div>
			<div class="form_cont">
				<table class="tablesorter">
					<thead>
						<tr>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.paymentRequest" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.paymentRequestAmount" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.paymentRequestCreateDate" /></th>
							<th><spring:message code="paymentrequestList.table.heading.paymentConfirmationNumber" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.amount" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.accountCode" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.accountDescr" /></th>
							<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.projectID" /></th>
							
							<%--
								<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.projectAcronym" /></th>
								<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.partner" /></th>
								<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.projectStatus" /></th>
								<th><spring:message code="viewCipeprojectPaymentRequestLineItems.table.heading.projectTitle" /></th>
								 --%>
						</tr>
					</thead>
					<tbody id="paymentRqst">
						<c:forEach items="${cipeprojectPaymentRequestLineItemsList}" var="lineItem">
							<tr>
								<td><a href="javascript://" class="edit-paymentrequest-link" paymentrequestId="${lineItem.paymentrequest.id}">${lineItem.paymentrequest.id}</a></td>
								<td><fmt:formatNumber value="${lineItem.paymentrequest.amount}" type="currency" minFractionDigits="2" pattern="$#,##0.##;" /></td>
								<td><fmt:formatDate pattern="MM-dd-yyyy" value="${lineItem.paymentrequest.creationDate}" /></td>
								<td>${lineItem.paymentrequest.invoicenumber}</td>
								<td><fmt:formatNumber value="${lineItem.paymentrequestamount}" type="currency" minFractionDigits="2" pattern="$#,##0.##;" /></td>
								<td>${lineItem.accountCode.accountCode}</td>
								<td>${lineItem.paymentrequest.payee.payeeName}</td>
								<td>${lineItem.cipeproject.projectID}</td>
								
								<%--
								    <td>${lineItem.cipeproject.acronym}</td>
									<td>${lineItem.cipeproject.partner.partnerName}</td>
									<td>${lineItem.cipeproject.cipeprojectstatus.displayName}</td>
									<td>${lineItem.cipeproject.projectTitle}</td>
									--%>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</div>
	</form:form>
</div>